home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / May 96 / Re Forcing a draw.6 < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  1.9 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Forcing a draw
  2. Sent:        5/20/96 11:54 AM
  3. Received:    5/22/96 8:31 AM
  4. From:        Laurent Delamare, laurentd@apple.com
  5. Reply-To:    ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. (I am resending this reply from last friday. It was returned to me with 
  9. the following error message "Returned mail: too many hops 19 (17 max)"... 
  10. does anyone know what it means??) 
  11.  
  12. >
  13. >The interface Draw(Environment *ev, ODFacet* odFacet, ODShape* invalidShape)
  14. >requires an ODFacet. How does a plain old FW_CView get hold of the right
  15. >facet?
  16. >
  17.  
  18. Bill, 
  19.  
  20. During normal updates a view's Draw method is called with the current 
  21. facet at which the update event is targeted (OpenDoc generates update 
  22. events for each facet).
  23. If you want to force a redraw yourself you must iterate on ALL the facets 
  24. of your frame otherwise you risk to miss something!
  25.  
  26. You may say: my part never opens more than 1 facet per frame, why bother? 
  27. The problem is that you never know where your part will be embedded and 
  28. what treatment it will suffer :-)  For instance, as a test, try the Embed 
  29. sample of ODF 1 which can split your part into 4 facets (a future version 
  30. will even make the facets rotate to create more confusion).
  31.  
  32. The correct way to handle facet drawing is thus to iterate as follows in 
  33. your view class:
  34.  
  35.         FW_CFrameFacetIterator ite(ev, GetFrame(ev));
  36.         for  (ODFacet* facet = ite.First(ev); ite.IsNotComplete(ev); 
  37.         facet = ite.Next(ev))
  38.         {
  39.                FW_CViewContext vc(ev, this, facet);
  40.             
  41.       // now you can draw in the right facet with the right view context
  42.      
  43.         }
  44.  
  45. This doesn't add any overhead in the general case of 1 facet per frame.
  46.  
  47.  
  48.  
  49. ______________________________________________________________________
  50. Laurent Delamare               laurentd@apple.com
  51. ODF Team                       http://www.devtools.apple.com/odf/
  52. Apple Computer, Inc.           http://www.opendoc.apple.com/
  53.